﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="BCThanhToanTongHop.aspx.cs" Inherits="BCThanhToanTongHop" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Assembly="DropDownCheckBoxes" Namespace="Saplin.Controls" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Báo cáo thanh toán tổng hợp</h3>
                </div>
               
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                   
                    <div style="margin-bottom: 5px;">
                        <div style="margin-bottom: 5px;">
                            <asp:DropDownList ID="dlThang" runat="server" Width="150px" AutoPostBack="true" CssClass="form-control"
                                OnSelectedIndexChanged="dlThang_SelectedIndexChanged">
                            </asp:DropDownList>
                            <asp:DropDownList ID="dlNam" runat="server" Width="110px" CssClass="form-control">
                            </asp:DropDownList>
                            <asp:TextBox ID="txtTuNgay" runat="server" placeholder="Từ ngày" Visible="true" Width="100px"
                                CssClass="form-control"></asp:TextBox>&nbsp;
                            <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" AutoPostBack="true"
                                Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>
                            <cc1:CalendarExtender ID="CalendarExtender11" runat="server" TargetControlID="txtTuNgay"
                                Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                            <cc1:CalendarExtender ID="CalendarExtender111" runat="server" TargetControlID="txtDenNgay"
                                Format="dd/MM/yyyy">
                            </cc1:CalendarExtender>
                            <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                                TargetControlID="txtTuNgay" ValidChars="/-" />
                            <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                                TargetControlID="txtDenNgay" ValidChars="/-" />
                            <asp:DropDownList ID="dropNhanVien" DataTextField="hoten" DataValueField="ids" runat="server"
                                Width="200px" CssClass="form-control">
                            </asp:DropDownList>
                            <asp:DropDownList ID="dldoituong" DataTextField="doituongchi" DataValueField="ids" Visible="false"
                                runat="server" Width="140px" CssClass="form-control">
                            </asp:DropDownList>
                            <asp:Button ID="btnXem" CssClass="btn btn-warning" runat="server" Text="Xem dữ liệu"
                                OnClick="btnXem_Click" />
                                <asp:Button ID="btnPrint" CssClass="btn btn-warning" runat="server" Text="Xuất báo cáo"
                                OnClick="btnPrint_Click" />
                        </div>
                    </div>
                    <div style="width: 100%; margin-top: 10px; overflow: auto;" class="wrapper">
                        <div style="width: 100%; max-height: 300px;">
                            <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                                BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                                EnableModelValidation="True" ShowFooter="true" Width="2000px" CssClass="form-control withall"
                                >
                                <Columns>
                                   
                                    <asp:BoundField DataField="ngaythang" ItemStyle-CssClass="padding" HeaderText="Ngày thanh toán"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />
                                    <asp:BoundField DataField="hoten" ItemStyle-CssClass="padding" HeaderText="Họ tên"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                        <asp:BoundField DataField="tenbophan" ItemStyle-CssClass="padding" HeaderText="Bộ phận"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                        <asp:BoundField DataField="tenchucvu" ItemStyle-CssClass="padding" HeaderText="Chức vụ"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    <asp:TemplateField HeaderText="Số phiếu thanh toán" ItemStyle-HorizontalAlign="Left"
                                        ItemStyle-CssClass="padding">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbSua114" Style="color: #000066;" runat="server" Text='<%#Eval("sophieutt") %>'
                                                CommandArgument='<%#Eval("ids")%>' CommandName="chitietthanhtoan" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Số PC" ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="padding">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbSua11" Style="color: #000066;" runat="server" Text='<%#Eval("sopc") %>'
                                                CommandArgument='<%#Eval("maphieuchi")%>' CommandName="chitiet" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Số phiếu thu" ItemStyle-HorizontalAlign="Left" ItemStyle-CssClass="padding">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="lbSua111" Style="color: #000066;" runat="server" Text='<%#Eval("sophieuthu") %>'
                                                CommandArgument='<%#Eval("maphieuthu")%>' CommandName="chitietphieuthu" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:BoundField DataField="sohoanchi" ItemStyle-CssClass="padding" HeaderText="Số hoàn chi"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                        <asp:BoundField DataField="sotienpc"  DataFormatString="{0:N0}" ItemStyle-CssClass="padding" HeaderText="Số tiền theo PC"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                          <asp:BoundField DataField="noidungthanhtoan" ItemStyle-CssClass="padding" HeaderText="Nội dung thanh toán"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                    <asp:BoundField DataField="sotienthanhtoan"  DataFormatString="{0:N0}" ItemStyle-CssClass="padding" HeaderText="Số tiền thanh toán"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                        <asp:BoundField DataField="sotienhoanchi"  DataFormatString="{0:N0}" ItemStyle-CssClass="padding" HeaderText="Số tiền hoàn chi"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                          <asp:BoundField DataField="sotienhoanthu"  DataFormatString="{0:N0}" ItemStyle-CssClass="padding" HeaderText="Số tiền hoàn thu"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    <asp:BoundField DataField="sotienconlai"  DataFormatString="{0:N0}" ItemStyle-CssClass="padding" HeaderText="Số tiền còn lại"
                                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" />
                                    
                                </Columns>
                                <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Left" />
                                <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                                <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                                <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                            </asp:GridView>
                        </div>
                    </div>
                    <div style="margin: 5px;">
                        <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                        <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                            OnClick="btnPre_Click" />
                        <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                            OnClick="btnNext_Click" />
                    </div>
                </div>
            </div>
            </div> </div>
            <asp:HiddenField ID="hdID" runat="server" />
            <asp:HiddenField ID="hdTuNgay" runat="server" />
            <asp:HiddenField ID="hdDenNgay" runat="server" />
            <asp:HiddenField ID="HiddenField1" runat="server" />
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnPrint" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
